﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TGB.Core.Infrastructure;

namespace TGBTech.WebAdmin.Controllers
{
    public class SoCTTaiKhoanController : Controller
    {
        public TGBTechDb db = new TGBTechDb();
        //
        // GET: /SoCTTaiKhoan/
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Create()
        {
            var tk = db.TaiKhoan.Select(p => new
            {
                Id = p.Id,
                Display = p.Id + " | " + p.Name
            }).ToList();
            ViewBag.TaiKhoan = new SelectList(tk, "Id", "Display");
            return View();
        }

        ////
        //// POST: /SoCTTaiKhoan/Create
        //[HttpPost]
        //public ActionResult Create(String TaiKhoan, DateTime? StartDate, DateTime? EndDate,
        //    Decimal? CoDauKy, Decimal? NoDauKy)
        //{
        //    try
        //    {
        //        // TODO: Add insert logic here
        //        if (SoHieu == null || SoHieu == "" || !StartDate.HasValue || !EndDate.HasValue)
        //        {
        //            return View();
        //        }

        //        //Goi services
        //        SoCaiTaiKhoanService service = new SoCaiTaiKhoanService();
        //        var model = service.createSoCaiTaiKhoan(SoHieu, StartDate.GetValueOrDefault(), EndDate.GetValueOrDefault(), CoDauKy.GetValueOrDefault(), NoDauKy.GetValueOrDefault());
        //        ViewBag.SoCaiTaiKhoan = model;

        //        var list = model.ListSoCaiTaiKhoanChiTiet;
        //        return View("Create", list);
        //    }
        //    catch
        //    {
        //        return View();
        //    }
        //}
	}
}